<!-- 模块说明 -->
<script setup lang="ts">
import { ref, onMounted, computed } from "vue";
import { useRouter } from "vue-router";
const router = useRouter(); // router.options.routes
console.log(router, "router");
const routesStatic = computed(() =>
    router.options.routes.filter((item) => !item.meta?.hidden)
);
</script>
<template>
    <div class="nav">
        <div class="list" v-for="item in routesStatic" :key="item.path">
            <router-link :to="item.path">
                <van-icon :name="(item.meta?.icon as string)"></van-icon>
                <p>{{ item.meta?.til }}</p>
            </router-link>
        </div>
</div>
</template>

<style lang="scss" scoped>
.nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    padding: 10px;
    border-top: 2px solid #e1e1e1;
    display: flex;
    background: #fff;

    .router-link-active {
        color: red;
    }

    a {
        color: gray;
    }

    .van-icon {
        font-size: 20px;
        margin: 4px 0;
    }

    .list {
        flex: 1;
        text-align: center;
    }
}
</style>
